package archive

import (
	"compress/zlib"
	"io"
)

var Zlib = &compressZlib{}

type compressZlib struct{}

func (receiver *compressZlib) Reader(reader io.Reader) (io.Reader, error) {
	zlibReader, err := zlib.NewReader(reader)
	defer zlibReader.Close()

	return zlibReader, err
}
func (receiver *compressZlib) Writer(writer io.Writer) io.Writer {
	zlibWriter := zlib.NewWriter(writer)
	defer zlibWriter.Close()

	return zlibWriter
}
